package cn.maidouya.basic.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class AjaxResult {
    private Boolean success = true;
    private String message = "操作成功";
    private Object resultObj;
    public static AjaxResult getResult(){
        return new AjaxResult();
    }
    public AjaxResult setResultObj(Object resultObj){
        this.resultObj = resultObj;
        return this;
    }
    public AjaxResult setSuccess(Boolean success){
        this.success = success;
        return this;
    }
    public AjaxResult setMessage(String message){
        this.setSuccess(false);
        this.message = message;
        return this;
    }
}